﻿@model WayCloud.ViewModel.RegisterInfo
@{
    ViewBag.Titile = "新用户注册";
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Titile</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/ez_css.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jqueryui/cupertino/jquery-ui.css")" rel="stylesheet"
          type="text/css" />
    <style type="text/css">
        html
        {
            height: 100%;
        }
        
        body
        {
            height: 100%;
            min-height: 610px;
            margin: 0px;
            font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
            font-size: 12px;
            color: #333333;
            position: relative;
            line-height: 1.2em;
            background-color: #dfeff9;
        }
        .search_input
        {
            width: 200px;
            height: 22px;
            padding: 4px 0 0 2px;
            border-width: 1px;
            margin-right: 5px;
            border-style: solid;
            font-size: 16px;
            border-color: #69C;
            background: white;
        }
    </style>
    <script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jqueryui/jquery-ui.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function () {
            var dialog = $("#divRegister").dialog({
                width: 600,
                height: 400,
                modal: true,
                draggable: false,
                resizable: false,
                open: function () {
                    $(".ui-dialog-titlebar-close").hide();
                }
            });

            dialog.parent().appendTo($("form"));

            $(":submit").button();

            showMessage();
        });

        function showMessage() {
            var message = '@ViewBag.Message';
            if (message) {
                if (message === "True") {
                    alert("注册成功！");
                    location.href = '/account/';
                }
                else {
                    alert("注册失败，请重试！");
                }
            }
        }
    </script>
</head>
<body>
    @using (Html.BeginForm("RegisertUser", "Register"))
    {
        <div id="divRegister" title="@ViewBag.Titile">
            <div class="ez-wr" style="text-align: left; margin-top: 20px;">
                <div class="ez-box" style="margin: 5px;">
                    <div class="ez-wr">
                        <div class="ez-fl ez-negmr ez-25" style="margin: 5px;">
                            <div class="ez-box">
                                @Html.LabelFor(p => p.AccountName)
                            </div>
                        </div>
                        <div class="ez-last ez-oh">
                            <div class="ez-box">
                                @Html.TextBoxFor(p => p.AccountName, new { @class = "search_input" })
                                <span><em>填写易于记忆的帐号</em></span>
                                <div>
                                    @Html.ValidationMessageFor(p => p.AccountName)
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ez-box" style="margin: 5px;">
                    <div class="ez-wr">
                        <div class="ez-fl ez-negmr ez-25" style="margin: 5px;">
                            <div class="ez-box">
                                @Html.LabelFor(p => p.Password)
                            </div>
                        </div>
                        <div class="ez-last ez-oh">
                            <div class="ez-box">
                                @Html.PasswordFor(p => p.Password, new { @class = "search_input" })
                                <span><em>密码长度不能小于3位</em></span>
                                <div>
                                    @Html.ValidationMessageFor(p => p.Password)
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ez-box" style="margin: 5px;">
                    <div class="ez-wr">
                        <div class="ez-fl ez-negmr ez-25" style="margin: 5px;">
                            <div class="ez-box">
                                @Html.LabelFor(p => p.ConfirmPassword)
                            </div>
                        </div>
                        <div class="ez-last ez-oh">
                            <div class="ez-box">
                                @Html.PasswordFor(p => p.ConfirmPassword, new { @class = "search_input" })
                                <span><em>再次填写密码</em></span>
                                <div>
                                    @Html.ValidationMessageFor(p => p.ConfirmPassword)
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ez-box" style="margin: 5px;">
                    <div class="ez-wr">
                        <div class="ez-fl ez-negmr ez-25" style="margin: 5px;">
                            <div class="ez-box">
                                @Html.LabelFor(p => p.UserName)
                            </div>
                        </div>
                        <div class="ez-last ez-oh">
                            <div class="ez-box">
                                @Html.TextBoxFor(p => p.UserName, new { @class = "search_input" })
                                <span><em>正确填写姓名可以获得更多服务</em></span>
                                <div>
                                    @Html.ValidationMessageFor(p => p.UserName)
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ez-box" style="margin: 5px;">
                    <div class="ez-wr">
                        <div class="ez-fl ez-negmr ez-25" style="margin: 5px;">
                            <div class="ez-box">
                                @Html.LabelFor(p => p.Email)
                            </div>
                        </div>
                        <div class="ez-last ez-oh">
                            <div class="ez-box">
                                @Html.TextBoxFor(p => p.Email, new { @class = "search_input" })
                                <span><em>Email地址可用于找回密码</em></span>
                                <div>
                                    @Html.ValidationMessageFor(p => p.Email)
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ez-box" style="margin: 5px;">
                    <div class="ez-wr">
                        <div class="ez-fl ez-negmr ez-25" style="margin: 5px;">
                            <div class="ez-box">
                                @Html.LabelFor(p => p.Phone)
                            </div>
                        </div>
                        <div class="ez-last ez-oh">
                            <div class="ez-box">
                                @Html.TextBoxFor(p => p.Phone, new { @class = "search_input" })
                                <span><em>手机号可用于接收短信</em></span>
                                <div>
                                    @Html.ValidationMessageFor(p => p.Phone)
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ez-box" style="margin-top: 15px; text-align: center;">
                    <input type="submit" value="注  册" />&nbsp;&nbsp;&nbsp;&nbsp; <a href="/account/" id="btnRegister">
                        返回登录页面</a>
                </div>
            </div>
        </div>
    }
</body>
</html>
